﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>新建案件</title>
    <link href="~/layui/css/layui.css" rel="stylesheet" />
    <script src="~/layui/layui.js"></script>
    <script src="~/lib/jquery/dist/jquery.js"></script>
    <script>
        layui.use('form', function () {
            var form = layui.form;

            form.on('submit(btnSave)', function (data) {
                $.ajax({
                    url: "/NewCase/Add",
                    type: "POST",
                    data: data.field,
                    success: function (response) {
                        if (result > 1) {
                            layer.msg("成功", { icon: 1 });
                        } else {
                            layer.msg("失败");
                        }
                        // 处理成功后的回调
                        console.log(response);
                    },
                    error: function (xhr, status, error) {
                        // 处理错误的回调
                        console.log(error);
                    }
                });
                return false; // 阻止表单的默认提交行为
            });
            //导出Excel
            function ExportExcel() {
                window.location.href = "/NewCase/ExportFile";
            }
        });
    </script>
</head>
<body>
    <div id="divContent">
        <input type="button" class="layui-btn layui-btn-blue2 layui-btn-sm" id="ExportExcel" onclick="ExportExcel()" value="导出" />
        <form class="layui-form" lay-filter="formInfo" style="width:600px;margin-top:200px;margin-left:300px;">
            <div class="layui-inline" style="margin-top:20px;">
                <label class="layui-form-label">案件公文号</label>
                <div class="layui-input-inline">
                    <input type="text" name="CaseDocument" lay-verify="required" placeholder="请输入案件公文号" autocomplete="off" class="layui-input" style="width:87%">
                </div>
            </div>
            <div class="layui-inline" style="margin-top:20px;">
                <label class="layui-form-label">事件类型</label>
                <div class="layui-input-inline">
                    <input type="text" name="EventType" lay-verify="required" placeholder="请输入事件类型" autocomplete="off" class="layui-input" style="width:87%">
                </div>
            </div>
            <div class="layui-inline" style="margin-top:20px;">
                <label class="layui-form-label">案件类型</label>
                <div class="layui-input-inline">
                    <select name="ClassificationId">
                        <option value="1">资讯类</option>
                        <option value="2">调解类</option>
                    </select>
@*                     <input type="text" name="ClassificationId" lay-verify="required" placeholder="请输入案件类型" autocomplete="off" class="layui-input" style="width:87%">
 *@                </div>
            </div>
            <div class="layui-inline" style="margin-top:20px;">
                <label class="layui-form-label">来电人姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="CallerName" lay-verify="required" placeholder="请输入来电人姓名" autocomplete="off" class="layui-input" style="width:87%">
                </div>
            </div>
            <div class="layui-inline" style="margin-top:20px;">
                <label class="layui-form-label">区接线员</label>
                <div class="layui-input-inline">
                    <input type="text" name="OperatorId" lay-verify="required" placeholder="请输入区接线员" autocomplete="off" class="layui-input" style="width:87%" value="科比">
                </div>
            </div>
            <div class="layui-inline" style="margin-top:20px;">
                <label class="layui-form-label">数据来源</label>
                <div class="layui-input-inline">
                    <select name="DataSources">
                        <option value="1">市长热线</option>
                        <option value="2">热心市民</option>
                        <option value="3">匿名举报</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline" style="margin-top:20px;">
                <label class="layui-form-label">报警社区</label>
                <div class="layui-input-inline">
                    <select name="CommunityId">
                        <option value="1">翻斗花园</option>
                        <option value="2">汤臣一品</option>
                        <option value="3">碧桂园</option>
                    </select>
@*                     <input type="text" name="CommunityId" lay-verify="required" placeholder="请输入报警社区" autocomplete="off" class="layui-input" style="width:87%">
 *@                </div>
            </div>
            <div class="layui-inline" style="margin-top:20px;">
                <label class="layui-form-label">联系电话</label>
                <div class="layui-input-inline">
                    <input type="text" name="telphone" lay-verify="required" placeholder="请输入联系电话" autocomplete="off" class="layui-input" style="width:87%">
                </div>
            </div>
            <div class="layui-form-item layui-form-text" style="margin-top:20px;">
                <label class="layui-form-label">来话内容</label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入来话内容" class="layui-textarea" name="CallerText"></textarea>
                </div>
            </div>
            @* 提交表单 *@
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit lay-filter="btnSave">保存</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</body>
</html>
